﻿namespace MEF_Test.Contracts
{
    using System.Collections.Generic;
    using System.Collections.ObjectModel;
    using System.Windows;

    // Just so IActionContextProvider can have access to an ancestor of BrowserNodeBase from within the MEF-Test.Contracts namespace
    public interface IBrowserNodeViewModel 
    {
        IFileHandler FileHandler { get;  }

        /// <summary>
        /// Gets all the actions for which the current node is supported.
        /// </summary>
        ObservableCollection<INodeAction> SupportedActions { get; }

        DataTemplate Template { get; }

        /// <summary>
        /// Gets the media handler.
        /// </summary>
        /// <value>The media handler.</value>
        IMediaHandler MediaHandler { get; }

        IActionContextProvider SelectProvider(IEnumerable<IActionContextProvider> compatibleProviders, INodeAction action);

        IBrowserDetailViewModel CreateDetailViewModel();
    }

    public interface IBrowserNodeViewModel<TFileHandler> : IBrowserNodeViewModel where TFileHandler : class, IFileHandler
    {
        /// <summary>
        /// Gets the NodeActionBases supported by the Node.
        /// </summary>
        IEnumerable<INodeAction> Actions { get; }

        /// <summary>
        /// Gets the file handler.
        /// </summary>
        /// <value>The file handler.</value>
        TFileHandler FileHandler { get; }
    }
}
